import { get,post } from './axios'


// 获取活动列表
async function getActiveList(data) {
    const url = `/admin/activity/list`
    const result = await get(url, data)
    return result
}

// 批量下架 批量删除
async function soldOutDelete(data) {
    const url = `/admin/activity/batchEdit`
    const result = await post(url, data)
    return result
}

// 添加活动
async function addActive(data) {
    const url = `/admin/activity/add`
    const result = await post(url, data)
    return result
}

// 编辑活动
async function editActive(data) {
    const url = `/admin/activity/edit`
    const result = await post(url, data)
    return result
}

// 活动主办中心
async function activeCenter(data) {
    const url = `/admin/store/list`
    const result = await get(url, data)
    return result
}

// 添加活动的时候上传图片的 接口
async function upImg(data) {
    const url = `/activity/visitor/uploadimage`
    const result = await post(url, data)
    return result
}

// 通过id获取单个活动详情
async function getOneActivity(data) {
    const url = `/admin/activity/find`
    const result = await get(url, data)
    return result
}

// 恢复已删除的活动 接口
async function recover(data) {
    const url = `/admin/activity/recover`
    const result = await post(url, data)
    return result
}

// 批量情况和恢复活动 接口
async function completelyAll(data) {
    const url = `/admin/activity/clear`
    const result = await post(url, data)
    return result
}

// 财务统计（活动订单）
async function financeOrder(data) {
    const url = `/admin/finance/order`
    const result = await get(url, data)
    return result
}

// 订单流水
async function financeOrderFlow(data) {
    const url = `/admin/finance/orderbill`
    const result = await get(url, data)
    return result
}

export {
    getActiveList,
    soldOutDelete,
    addActive,
    activeCenter,
    upImg,
    getOneActivity,
    editActive,
    recover,
    completelyAll,
    financeOrder,
    financeOrderFlow,
}
